package com.dongdongshop.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
//创建freemarker配置类
@Configuration
public class MyFreemarkerConfig {


    @Bean
    public FreeMarkerConfigurer freeMarkerConfigurer(){
        //1.创建一个Configuration对象
        FreeMarkerConfigurer fc=new FreeMarkerConfigurer();
        //2.设置模板所在路径
        fc.setTemplateLoaderPath("classpath:freemaker");
        //3.设置模板文件使用的字符集
        fc.setDefaultEncoding("utf-8");


        return fc;
    }

}
